package com.bdqn.spark.chapter05.value

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object Spark07_RDD_Operator_Transform {
  def main(args: Array[String]): Unit = {
    val sparkConf = new SparkConf()
      .setMaster("local[*]")
      .setAppName("operator-groupby")
    val sc = new SparkContext(sparkConf)

    val sourceRDD = sc.makeRDD(List(1, 2, 3, 4))
    // 过滤奇数或者偶数
    sourceRDD.filter(
      _ % 2 == 1
    ).collect().foreach(println)

    sc.stop()
  }
}
